package org.shj.thread.book2.chapter12.active;


class Proxy implements ActiveObject{

	private final SchedulerThread scheduler;
	private final Servant servant;
	
	public Proxy(SchedulerThread scheduler, Servant servant){
		this.scheduler = scheduler;
		this.servant = servant;
	}
	
	public Result makeString(int count, char fillchar){
		FutureResult future = new FutureResult();
		scheduler.invoke(new MakeStringRequest(servant, future, count, fillchar));
		return future;
	}
	
	public void displayString(String str){
		scheduler.invoke(new DisplayStringRequest(servant, str));
	}
}
